USE dryad;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for act_workflow_formdata
-- ----------------------------
DROP TABLE IF EXISTS `act_workflow_formdata`;
CREATE TABLE `act_workflow_formdata`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '唯一标识符',
  `proc_def_id` varchar(64)  NULL DEFAULT NULL COMMENT '定义id',
  `proc_inst_id` varchar(64)  NULL DEFAULT NULL COMMENT '实例id',
  `business_key` varchar(64)  NULL DEFAULT NULL COMMENT '事务key',
  `form_key` varchar(255)  NULL DEFAULT NULL COMMENT '表单Key',
  `control_id` varchar(64)  NULL DEFAULT NULL COMMENT '表单id',
  `control_name` varchar(64)  NULL DEFAULT NULL COMMENT '表单名',
  `control_value` varchar(2000)  NULL DEFAULT NULL COMMENT '表单值',
  `task_node_name` varchar(64)  NULL DEFAULT NULL COMMENT '任务节点名称',
  `created_name` varchar(64)  NULL DEFAULT NULL COMMENT '创建者姓名',
  `created_by` varchar(32)  NULL DEFAULT NULL COMMENT '创建者',
  `created_time` datetime  NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` datetime  DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '动态表单' ROW_FORMAT = Dynamic;


-- ----------------------------
-- Table structure for t_workflow_leave
-- ----------------------------
DROP TABLE IF EXISTS `t_workflow_leave`;
CREATE TABLE `t_workflow_leave`  (
  `id` varchar(36)  NOT NULL COMMENT '主键ID 映射 BUSINESS_KEY_',
  `type` char(36)  NULL DEFAULT NULL COMMENT '请假类型',
  `title` varchar(100)  NULL DEFAULT NULL COMMENT '标题',
  `reason` varchar(500)  NULL DEFAULT NULL COMMENT '原因',
  `leave_start_time` date NULL DEFAULT NULL COMMENT '开始时间',
  `leave_end_time` date NULL DEFAULT NULL COMMENT '结束时间',
  `attachment_link` varchar(2048)  NULL DEFAULT NULL COMMENT '附件',
  `instance_id` varchar(36)  NULL DEFAULT NULL COMMENT '流程实例ID',
  `state` char(1)  NULL DEFAULT NULL COMMENT '状态 0-进行中 1-成功 2-失败',
  `created_name` varchar(36)  NULL DEFAULT NULL COMMENT '创建者名称',
  `created_by` varchar(64)  NULL DEFAULT NULL COMMENT '创建者',
  `created_time` datetime  NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` datetime  DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '请假信息' ROW_FORMAT = Dynamic;
create index idx_workflow_leave_ii on t_workflow_leave
(
   instance_id
);

BEGIN;
INSERT INTO `t_workflow_leave` (`id`,`type`,`title`,`reason`,`leave_start_time`,`leave_end_time`,`attachment_link`,`instance_id`,`state`,`created_name`,`created_by`,`created_time`,`updated_time`) VALUES ('24bc76de-e16a-4354-948d-b8444f5b87d7','事假','elliott的事假申请','不想看到你','2020-12-17','2020-12-18',NULL,'9c6972d8-3b54-11eb-bbbd-2ec6bdc858e1','0',NULL,'elliott','2020-12-11 10:00:15',NULL);
INSERT INTO `t_workflow_leave` (`id`,`type`,`title`,`reason`,`leave_start_time`,`leave_end_time`,`attachment_link`,`instance_id`,`state`,`created_name`,`created_by`,`created_time`,`updated_time`) VALUES ('3ec099c2-ceaa-4711-bc8d-8ec67d8e1155','年假','elliott的年假申请','不想看到你','2020-12-11','2020-12-17',NULL,'83e7a62f-3acf-11eb-a1f5-2ec6bdc858e1','1',NULL,'elliott','2020-12-10 18:07:31','2020-12-10 18:08:40');
INSERT INTO `t_workflow_leave` (`id`,`type`,`title`,`reason`,`leave_start_time`,`leave_end_time`,`attachment_link`,`instance_id`,`state`,`created_name`,`created_by`,`created_time`,`updated_time`) VALUES ('89eeecac-a5a9-4927-bcb7-f2e17bdad7c6','病假','elliott的病假申请','不想看到你','2020-12-13','2020-12-15',NULL,'8d66ed56-3b4f-11eb-ab10-2ec6bdc858e1','2',NULL,'elliott','2020-12-11 09:24:03','2020-12-11 09:54:43');

COMMIT;

SET FOREIGN_KEY_CHECKS = 1;